package com.moxiao.yfjh.framework.pay.core.enums.transfer;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 渠道的转账状态枚举
 *
 * @author jason
 */
@Getter
@AllArgsConstructor
public enum PayTransferStatusRespEnum {

    WAITING(0, "转账中"),
    /**
     * TODO 转账到银行卡. 会有T+0 T+1 到账的请情况。 还未实现
     */
    IN_PROGRESS(10, "转账进行中"),

    SUCCESS(20, "转账成功"),

    CLOSED(30, "转账关闭"),

    //===========微信转账状态返回 ======================
    ACCEPTED(1, "已受理"),

    PROCESSING(11, "转账中"),

    WAIT_PAY(21, "待付款确认"),

    FINISHED(31, "已完成"),

    WX_CLOSED(40, "转账关闭");


    private final Integer status;
    private final String name;

    public static boolean isSuccess(Integer status) {
        return Objects.equals(status, SUCCESS.getStatus());
    }

    public static boolean isClosed(Integer status) {
        return Objects.equals(status, CLOSED.getStatus());
    }
}
